load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "fs",
    srcs = [
        "category.go",
        "encryption_at_rest.go",
        "file_registry.go",
        "fs.go",
        "safewrite.go",
        "sticky_vfs.go",
        "temp_dir.go",
        "test_utils.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/storage/fs",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/cli/exit",
        "//pkg/settings",
        "//pkg/storage/disk",
        "//pkg/storage/enginepb",
        "//pkg/util/buildutil",
        "//pkg/util/envutil",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_cockroachdb_pebble//:pebble",
        "@com_github_cockroachdb_pebble//record",
        "@com_github_cockroachdb_pebble//sstable",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_cockroachdb_pebble//vfs/atomicfs",
        "@com_github_cockroachdb_pebble//vfs/vfstest",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "fs_test",
    srcs = [
        "file_registry_test.go",
        "safewrite_test.go",
        "sticky_vfs_test.go",
        "temp_dir_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":fs"],
    deps = [
        "//pkg/base",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/skip",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/stop",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_kr_pretty//:pretty",
        "@com_github_stretchr_testify//require",
    ],
)
